package br.com.condominio.controller;

import java.sql.SQLException;
import java.util.List;

import br.com.condominio.model.dao.ResidenciaDAO;
import br.com.condominio.view.vo.ResidenciaVO;

public class ResidenciaController {

	private ResidenciaDAO dao;

	public ResidenciaController() throws ClassNotFoundException, SQLException {
		super();
		this.dao = new ResidenciaDAO();
	}

	public boolean atualizar(ResidenciaVO residencia) throws SQLException {
		return (this.dao.atualizar(residencia));
	}

	public boolean criar(ResidenciaVO residencia) throws SQLException,
			ClassNotFoundException {
		return (dao.criar(residencia));
	}

	public List<ResidenciaVO> getAllResidencias() throws SQLException,
			ClassNotFoundException {
		return (dao.getAllResidencias());
	}

	public boolean excluir(ResidenciaVO residencia) throws SQLException,
			ClassNotFoundException {
		return (dao.excluir(residencia));
	}
	
	public ResidenciaVO getResidenciaByID(int id) throws SQLException {		
		return (dao.getResidenciaByID(id));
	}
}
